import socket

socket = socket.socket()
socket.connect(("127.0.0.1", 8888))
while True:
    send_meg = input("请输入要发送的数据")
    if send_meg == "exit":
        break
    socket.send(send_meg.encode("utf-8"))
    recv_data = socket.recv(1024)
    print("服务端返回的数据是 ", recv_data.decode("utf-8"))
socket.close()
print("客户端开始退出")
